#define _CRT_SECURE_NO_WARNINGS
#include<stdio.h>
int add(int x, int y)
{
	return x + y;
}
int sub(int x, int y)
{
	return x - y;
}
int mul(int x,int y)
{
	return x * y;
}
int div(int x, int y)
{
	return x / y;
}
void menu()
{
	printf("1.add\n");
	printf("2.sub\n");
	printf("3.mul\n");
	printf("4.div\n");
	printf("0.exit\n");
}
int main()
{
	int a, b;
	menu();
	int input;
	int (*parr[5])(int, int) = { NULL,add,sub,mul,div };
	scanf("%d", &input);
	while (input < 5 && input>0) {
		scanf("%d%d", &a, &b);
		int ret = parr[input](a, b);
		printf("%d", ret);
	}
	return 0;
}